package com.mc.read.dao.mapper;

import com.mc.read.dao.models.Bookinformation;
import com.mc.read.dao.models.BookinformationCustom;
import com.mc.read.dao.models.BookinformationExample;
import com.mc.read.dao.vo.BookPageVo;
import com.mc.read.dao.vo.BookTypeLabel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BookinformationMapper {
    int countByExample(BookinformationExample example);

    int deleteByExample(BookinformationExample example);

    int deleteByPrimaryKey(Integer bookinformationid);

    int insert(Bookinformation record);

    int insertSelective(Bookinformation record);

    List<Bookinformation> selectByExample(BookinformationExample example);

    Bookinformation selectByPrimaryKey(Integer bookinformationid);

    int updateByExampleSelective(@Param("record") Bookinformation record, @Param("example") BookinformationExample example);

    int updateByExample(@Param("record") Bookinformation record, @Param("example") BookinformationExample example);

    int updateByPrimaryKeySelective(Bookinformation record);

    int updateByPrimaryKey(Bookinformation record);


    int insertGetId(Bookinformation record);

    //修改阅读数
    int updateReadNum(Integer id);
    //修改收藏数
    int updateCollectionNum(Integer id);


    List<Bookinformation> selectVipList(BookinformationCustom bookinformation);

    List<Bookinformation> selectLabelList(BookinformationCustom bookinformation);

    List<Bookinformation> selectBookByBookType(BookinformationCustom bookinformation);

    List<Bookinformation> selectBookByRandom(BookinformationCustom bookinformation);
    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 查询书籍列表 selectBookList
     **/
    List<Bookinformation> selectBookList(BookPageVo bookPageVo);
    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 修改书籍信息 updateBookInfo
     **/
    int updateBookInfo(Bookinformation record);

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 查询热门书籍列表 selectBookList
     **/
    List<Bookinformation> selectBookListByHot(BookPageVo bookPageVo);

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/7/01
     * 根据类型和标签搜索书籍 selectBookByTypeAndLabel
     **/
    List<Bookinformation> selectBookByTypeAndLabel(BookTypeLabel bookTypeLabel);

}